<%@ page language="java" %>
<%@ page session="true" %>
<%@ page import="java.sql.*,java.io.*,java.util.Random"%>
 

<HEAD>


	<script LANGUAGE="Javascript" SRC="Images/validate.js"></script>


	<LINK href="styles.css" type="text/css" rel="stylesheet">

</HEAD>
<BODY class=Grad>
<h2 align=center>Update</h2>

<%

	Connection con=null;
	ResultSet rs=null;
	Statement stmt=null;
	String userid = request.getParameter("userid");
	String TotalExperience = "0";
	String Year = request.getParameter("Year");	
	String Months = request.getParameter("Months");	
	
	TotalExperience = Year+"."+Months;
	String AnnualSalary = request.getParameter("AnnualSalary");	
	String FunctionalArea = request.getParameter("FunctionalArea");	
	String CompanyName = request.getParameter("CompanyName");	
	String KeySkills = request.getParameter("KeySkills");	
	String ResumeTitle = request.getParameter("ResumeTitle");
	String TextResume = request.getParameter("TextResume");	
	try{
			
			/* Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
			con = DriverManager.getConnection("jdbc:odbc:JobPortal","root",""); */

			Class.forName("com.mysql.jdbc.Driver");
			con = DriverManager.getConnection("jdbc:mysql://localhost:3306/jobmiller","root","root");


			stmt =  con.createStatement();
	
			
			String Query = "Update professionalinformation SET TotalExperience='"+TotalExperience+"', AnnualSalary='"+AnnualSalary+"' ,FunctionalArea='"+FunctionalArea+"', CompanyName='"+CompanyName+"' , KeySkills='"+KeySkills+"',ResumeTitle='"+ResumeTitle+"' where userid='"+userid+"'";
			System.out.println(Query);
			int result = stmt.executeUpdate(Query);
			if( result > 0)	{
				%><h3 align=center>Inserted into database sucessfully</h3><%
			}
			else{
				%><h3 align=center>Error in updating..please try again</h3><% 
			}
			stmt.close();
			con.close();
		}catch(Exception e){
			stmt.close();
			con.close();
			%><%=e%><%
		}
	
%>
</BODY>


